import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 系统设置api接口集合
 * @method systemUserList 系统用户列表
 * @method resetPassword 重置密码
 * @method changeStatus 状态变更
 * @method changeUserRole 修改用户权限
 * @method rolePermissions 绑定角色菜单
 * @method addUser 新增职工
 * @method editUser 修改职工
 */

export function systemApi() {
	return {
		systemUserList: (data) => {
			return request({
				url: '/api/system/user',
				method: 'post',
				data,
			});
		},
    resetPassword: (data) => {
			return request({
				url: '/user/reset_password',
				method: 'post',
				data,
			});
		},
    changeStatus: (data) => {
			return request({
				url: '/user/change_status',
				method: 'post',
				data,
			});
		},
		changeUserRole: (data) => {
			return request({
				url: '/user/user_role',
				method: 'post',
				data
			});
		},
		simpleRoleList: () => {
			return request({
				url: '/role/simple_list',
				method: 'get',
			});
		},
		roleList: (data) => {
			return request({
				url: '/role',
				method: 'post',
				data
			});
		},
		rolePermissions: (data) => {
			return request({
				url: '/role/permissions',
				method: 'post',
				data
			});
		},
		addUser: (data) => {
			return request({
				url: '/user/store',
				method: 'post',
				data
			});
		},
		editUser: (data) => {
			return request({
				url: '/user/update',
				method: 'post',
				data
			});
		},
		editPassword: (data) => {
			return request({
				url: '/auth/change_password',
				method: 'post',
				data
			});
		},
		bedList: (params) => {
			return request({
				url: '/bed/list',
				method: 'get',
				params:params
			});
		},
		disableBed: (data) => {
			return request({
				url: '/bed/disable',
				method: 'post',
				data
			});
		},
		enableBed: (data) => {
			return request({
				url: '/bed/enable',
				method: 'post',
				data
			});
		},
		hideBed: (data) => {
			return request({
				url: '/bed/hidden',
				method: 'post',
				data
			});
		},
		showBed: (data) => {
			return request({
				url: '/bed/display',
				method: 'post',
				data
			});
		},
	};
}


